from flask import Flask,render_template,request


app = Flask(__name__)

@app.route("/register",methods=['GET','POST'])
def register():
    if request.method=="GET":
        return render_template("register.html")
    else:
        user = request.form.get('username')
        pwd = request.form.get('password')
        sex = request.form.get('sex')
        hobby = request.form.getlist('hobby')
        city = request.form.get("city")
        skill = request.form.getlist('skill')
        more = request.form.get('more')
        print(user,pwd,sex,hobby,city,skill,more)
        return "注册成功"

@app.route("/login",methods=['GET','POST'])
def login():
    if request.method=="GET":
        return render_template("login.html")
    else:
        user = request.form.get('username')
        pwd = request.form.get('password')
        print(request.form)
        print(user,pwd)
        return "登录成功"

@app.route("/index",methods=['GET'])
def index():
    return render_template("index.html")



if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000 , debug=True)